package com.weigang.consumer;


import com.weigang.config.RabbitMqConfig;
import com.weigang.model.CustomMessage;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class RabbitMqConsumer {

    @RabbitListener(queues = RabbitMqConfig.QUEUE_NAME)
    public void receiveMessage(String message) {
        System.out.println("Received message: " + message);
    }

    @RabbitListener(queues = RabbitMqConfig.QUEUE_NAME)
    public void receiveMessageObj(CustomMessage message) {
        System.out.println("Received object message: " + message.toString());
    }
}
